package com.heart.sell.pojo;

import com.heart.sell.enums.OrderStatusEnum;
import com.heart.sell.enums.PayStatusEnum;
import lombok.Data;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.math.BigDecimal;
import java.util.Date;

/**
 * @author Luo Zhen
 * @create 2019-04-23 13:15
 */
@Table(name = "order_master")
@Entity
@Data
@DynamicUpdate
public class OrderMaster {

    @Id
    private String orderId;

    private String buyerName;

    private String buyerPhone;

    private String buyerAddress;

    private String buyerOpenid;

    private BigDecimal orderAmount;

    private Integer orderStatus = OrderStatusEnum.NEW.getCode();

    private Integer payStatus = PayStatusEnum.WAIT.getCode();

    private Date createTime;

    private Date updateTime;

    /** 此注解用来忽略映射时候的属性(不建议这么用  一般用dto模型)*/
//    @Transient
//    private List<OrderDetail> orderDetailList;
}
